const webpack=require('webpack');
const htmlwebpackplugin=require('html-webpack-plugin');

module.exports = {
  entry: __dirname + "/main.js",
  output: {
      path: __dirname + "/dist/",
      filename: "bundle.js"
  },
  devServer:{
    open:true,
    hot:true,
  
  },
  plugins:[
    new webpack.HotModuleReplacementPlugin(),
    new htmlwebpackplugin({
      template:__dirname + "/src/index.html",
      filename:"index.html"
        })
  ],

  module:{
    rules:[
        {test:/\.css$/,use:['style-loader','css-loader']},
        {test:/\.(jpg|png|gif|bmp)$/,use:'url-loader?limit=8946&name=[hash:8]-[name].[ext]'},
        {test:/\.(eot|svg|ttf|woff|woff2)$/,use:'url-loader'},
        {test:/\.js$/,use:'babel-loader',exclude:/node_modules/},
        {test:/\.vue$/,use:'vue-loader'},
    ]
  },
  resolve:{
    alias:{
      "vue$":"vue/dist/vue.js"
    }
    
      }
  
}